<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>className</title>
        <style>
            .fix{
                width: 300px;
                height: 50px;
                background-color: coral;
                color: white;
                font-size: 25px;
            }
            .mystyle{
                width: 300px;
                height: 50px;
                background-color: red;
                color: white;
                font-size: 25px;
            }

        </style>
    </head>
    <body>
        <p id="demo">点击按钮改变class属性值</p>
        <button  onclick="myFunction()">点我</button>
        <div id="myid" class="fix">
            我是一个 DIV 元素。
        </div>
        <script type="text/javascript" src="className.js"></script>
    </body>
</html>